package com.zjj.learn.javaplus.pkg06.demo602;

import java.io.File;
import java.io.IOException;

public class FileTest1 {

    public static void main(String[] args) throws IOException {
        // 文件路径名
        String pathname = "D:\\ProgramData\\wood\\code\\javaplus-learn\\src\\main\\resources\\pkg06\\aaa.txt";
        File file1 = new File(pathname);
        long len = file1.length();
        System.out.println("len = " + len);

        if (!file1.exists()) {
            System.out.println("文件存在，创建文件");
            file1.createNewFile();
        }


    }
}
